package com.example.im.infra.handle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author PC
 * 线程池拒绝策略
 */
public class ImRejectExecutionHandler implements RejectedExecutionHandler {
    private final static Logger logger = LoggerFactory.getLogger(ImRejectExecutionHandler.class);

    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        logger.error("error.im.executor.reject");
    }
}
